package com.knowledge.common.enums;

import lombok.Getter;

/**
 * @author zzz
 * @title: NewsTypeEnum
 * @projectName blog-api
 * @description: TODO
 * @date 2022/3/415:31
 */
@Getter
public enum NewsTypeEnum {

    /**1-分享消息,2-好友申请,3-同意好友申请*/
    SHARE(1,"${userName}分享一篇【${title}】文章给您"),
    APPLY_FRIEND(2,"${userName}申请添加您为好友"),
    AGREE_FRIEND_APPLY(3,"${userName}同意您的好友申请"),
    ;

    private Integer type;
    private String contentTemplate;

    NewsTypeEnum(Integer type, String contentTemplate){
        this.type = type;
        this.contentTemplate = contentTemplate;
    }

    public static String getContentTemplate(Integer type){
        for (NewsTypeEnum newsTypeEnum : NewsTypeEnum.values()){
            if (newsTypeEnum.getType().equals(type)){
                return newsTypeEnum.getContentTemplate();
            }
        }
        return null;
    }
}
